@echo off
echo 开始生成 AAR 包...

echo 步骤 1: 清理旧的构建文件...
if exist mylibrary\build\outputs\aar\*.aar del mylibrary\build\outputs\aar\*.aar
if exist mylibrary\build\*.jar del mylibrary\build\*.jar
if exist mylibrary\build\*.aar del mylibrary\build\*.aar

echo 步骤 2: 生成 AAR 包...
.\gradlew.bat :mylibrary:assembleRelease

if %errorlevel% neq 0 (
    echo AAR 生成失败！
    pause
    exit /b 1
)

echo 步骤 3: 复制并重命名 AAR 文件...
if exist mylibrary\build\outputs\aar\mylibrary-release.aar (
    copy mylibrary\build\outputs\aar\mylibrary-release.aar mylibrary\build\nsgfUtil_V1.0.aar
    echo AAR 文件已复制到: mylibrary\build\nsgfUtil_V1.0.aar
) else (
    echo 错误: 找不到生成的 AAR 文件
    pause
    exit /b 1
)

echo 步骤 4: 检查生成的文件...
dir mylibrary\build\*.aar
dir mylibrary\build\*.jar

echo.
echo ========================================
echo AAR 包生成完成！
echo 文件位置: mylibrary\build\nsgfUtil_V1.0.aar
echo ========================================
pause


















